package com.example.homework.homework04;

public class Computer {
    public void use(USB usb) {
        usb.connect();
        if (usb instanceof KeyBoard) {
            ((KeyBoard) usb).input();
        } else if (usb instanceof Mouse) {
            ((Mouse) usb).click();
        }
        usb.disconnect();
    }
}
